vCard component

vCard is a new standard for electronic business cards, developed by Versit Consortium (http://www.versit.com) and maintained by the Internet Mail Consortium (IMC, http://www.imc.org). vCard is used for personal data interchange (PDI) and is supported by popular white pages services such as Four11 (http://www.four11.com), Populus Intelligent People Locator (http://www.populus.net),  also it is implemented in the popular email programs and database software, such as Microsoft Outlook and Outlook express, Netscape Communicator, Lotus Organizer 97 GS, Sidekick 98 and many many more.

You can get more information about vCard at IMC pages.  Check out:

http://www.imc.org/pdi

You will also find there the documentation about vCard and vCalendar objects.

TmsVCard component reference

Limitations

Installation

Contact


Limitations

ArGoSoft vCard component complies with the requirements of vCard v2.1, but it does not support binary properties, such as IMAGE, LOGO, SOUND.

Component does not decode the fields which are encoded using Quoted-Printable encoding method.

The binary properties, also decoding of Quoted-Printable and Base64 encoded fields will be implemented in more advanced vCard component, which will be a part of the Internet Mail Suite, developed by ArGo Software Design (http://www.argosoft.com).


Installation

TmsVCard component will work only with 32 bit versions of Delphi and BCBuilder.

In Delphi 2 and Borland C++ Builder: install the file msvcard.pas,

in Delphi 3 - a package vcard.dpl.  In Delphi 3 you probably also will need to add the path to the vCard files manually, in Tools - Environment Options - Library.

TmsVCard component should appear in the ArGoSoft tab on the component palette.


Contact

You can contact ArGo Software Design by:

Internet mail:	support@argosoft.com

CompuServe:	[75231,330]

WWW:	http://www.argosoft.com

Fax:	+1-416-352-5054

Mail:	ArGo Software Design

77 Davisville Ave. Suite 2107

Toronto Ontario M4S 1G4

Canada


TmsVCard component

properties	methods

You can use TmsVCard component to generate standard vCard files, also read and parse the data contained in vCard files.

You can take a look at demo program vcard.dpr, which is included in this package.


properties

BusinessInfo

DeliveryInfo

ExplanatoryInfo

Identification

TelecomInfo


methods

Clear

Assign

LoadFromStream

LoadFromFile

SaveToStream

SaveToFile


Clear method

unit

msVCard;

applies to

TmsVCard component;

declaration

procedure Clear;

description

Clears all fields of TmsVCard component instance


Assign method

unit

msVCard;

applies to

TmsVCard component;

declaration

procedure Assign(Value : TPersistent); override;

description

You can use this method to assign to the instance of TmsVCard component another instance of the component.  If you are trying to assign another descendant of TPersistent, there will be an exception, generated by inherited Assign method.


LoadFromStream method

unit

msVCard;

applies to

TmsVCard component;

declaration

procedure LoadFromStream(Stream : TStream);

description

Loads the vCard object from stream and fills in the properties of TmsVCard component.


LoadFromFile method

unit

msVCard;

applies to

TmsVCard component;

declaration

procedure LoadFromFile(const FileName : string);

description

Loads the vCard object from the file, indicated in FileName parameter and fills in the properties of TmsVCard component.


SaveToStream method

unit

msVCard;

applies to

TmsVCard component;

declaration

procedure SaveToStream(Stream : TSream);

description

Saves a contents if TmsVCard component into the stream according to the standard format of vCard specifications.


SaveToFile method

unit

msVCard;

applies to

TmsVCard component;

declaration

procedure SaveToFile(const FileName : string);

description

Saves the contents of TmsVCard component into the file, specified in FileName parameter, according to vCard specifications.


BusinessInfo property

unit

msVCard;

applies to

TmsVCard component;

declaration

property BusinessInfo : TmsBusinessInfo;

description

Contains the business related information related to the person or company associated with vCard object.  See the description of TmsBusinessInfo class for more information.


TmsBusinessInfo class

unit msVCls;

description

Has three published properties: Title, Role and Company.

Title - job title, e.g. President;

Role - role in the company, e.g. Programmer;

Company property is of type TmsCompanyRec, which is also declared in the unit msVCls and contains two properties:

Name - company name;

AUnit - unit of the company (we had to add A in front, because unit is a reserved word in Object pascal).

Example:

msVCard1.BusinessInfo.Title:='Sales manager';

msVCard1.Businessinfo.Role:='';

msVCard1.BusinessInfo.Company.Name:='Somecompany Ltd.';

msVCard1.BusinessInfo.Unit:='Sales department';


DeliveryInfo property

unit msVCard;

applies to

TmsVCard component;

declaration

property DeliveryInfo : TmsDeliveryInfo;

description

Contains address information for the subject associated with vCard.  Can hold two addresses.  See description of TmsDeliveryInfo class for more information.


ExplanatoryInfo property

unit msVCard;

applies to

TmsVCard component;

declaration

property ExplanatoryInfo : TmsExplanatoryInfo;

description

Contains additional information about the subject associated with vCard, such as two URLs and additional notes.  See TmsExplanatoryInfo class description for more information.


Identification property

unit msVCard;

applies to

TmsVCard component;

declaration

property Identification : TmsIdentification;

description

Contains identification information about subject, such as name, suffix, prefix and so on.  See the description of TmsIdentification class for more information.


TelecomInfo property

unit msVCard;

applies to

TmsVCard component;

declaration

property TelecomInfo : TmsTelecomInfo;

description

Can hold three telephone numbers and two email addresses, associated with the vCard object.  See TmsTelecomInfo class reference for more information.


TmsDeliveryInfo class

unit msVCls;

declaration

TmsDeliveryInfo = class(TPersistent);

description

Holds two addresses - two properties, Address1 and Address2.  Each Address property is TmsAddressRec.


TmsAddressRec class

unit msVCls;

declaration

TmsAddressRec = class(TPersistent);

description

Contains the address information, included in the vCard object.  Contains following published properties:

Attributes  : TmsAddressAttributes

Address attributes, such as Domestic, International, Home, Work.  See TmsAddressType reference for more information.

POAddress : string;

ExtendedAddress : string;

Street : string;

Locality : string;

Region : string;

PostalCode : string;

Country : string;

For example:

with msVCard1.DeliveryInfo.Address1 do

begin

  Include(Attributes,msaPostal);

  POAddress:='';

  ExtendedAddress:='';

  Street:='123 Anystreet, Suite 12';

  Locality:='Anycity';

  Region:='Somestate';

  PostalCode:='222222';

  Country:='Somecountry';

end;


TmsAddressAttributes type

unit msVCls;

declaration

  TmsAddressType = (msaDomestic, msaInternational, msaPostal, msaParcel, msaHome, msaWork);

  TmsAddressAtrributes = set of TmsAddressType;

This is a type of the Attributes of TmsAddressRec class.  The values are self explanatory.


TmsExplanatoryInfo class

unit msVCls;

description

TmsExplanatoryInfo = class(TPersistent);

description

This is a type of ExplanatoryInfo property of TmsVCard component and contains three published fields:

Comment : TStrings;

URL1 : string;

URL2 : string;

Comments contains the additional information for the subject associated with vCard, URL1 and URL2 may include the ULRs of WWW pages where one can obtain up to date information about the subject.


TmsIdentification class

unit msVCls;

declaration

TmsIdentification = class(TPersistent);

description

Type of the Identification property of TmsVCard component.  Contains two published fields:

FormattedName : string;

Name : TmsNameRec;

FormattedName property contains the name of the subject as it should appear in the envelope salutations, official letters and so on.

TmsNameRec class contains five sub properties:

FamilyName : string;

GivenName : string;

AdditionalNames : string;

Prefix : string;

Suffix : string;

Example:

with msVCard1.Identification do

begin

  with Name do

  begin

    FamilyName:='Doe';

    GivenName:='John';

    Preffix:='Mr.';

    Suffix:='Esq.';

  end;

  FormattedName:='J Doe';

end;


TmsTelecomInfo class

unit msVCls;

declaration

TmsTelecomInfo = class(TPersistent);

description

Type of TelecomInfo property of TmsVCard component.  Phone1, Phone2, Phone3 are of type TmsPhoneRec and are holding the information about three phone numbers, Email1 and Email2 are of type TmsEmailRec and contain the information about three email addresses.


TmsPhoneRec class

unit msVCls;

declaration

TmsPhoneRec = class(TPersistent)

description

Contains the information about phone numbers.  Has two published properties:

Attributes : TmsPhoneAttributes;

Number : string;

Number property contains the phone number itself, Attributes are indicating the type of phone numbers.

TmsPhoneAttributes is declared as:

TmsPhoneAttributes = set of TmsPhoneType;

where TmsPhoneType is:

TmsPhoneType = (mstPreferred, mstWork, mstHome, mstVoice, mstFax, mstMessaging, mstCellular, mstPager, mstBBS, mstModem, mstCar, mstISDN, mstVideo);

You can set the the elements of the Attributes set to indicate the character of the phone number.

Example:

with msVCard1.TelecomInfo.Phone1 do

begin

  Attributes:=[mstPreferred, mstVoice, mstMessaging];

  Number:='+1-416-231-2222';

end;

The above example indicates that the phone number is a preferred one, and is voice and has massaging service.


TmsEmailRec class

unit msVCls;

declaration

TmsEmailRec = class(TPersistent);

description

The used in TelecomInfo property of TmsVCard component.  Contains the information about an email address.  Has two published properties:

EmailType : TmsEmailType;

Address : string;

Address contains the email address itself.

TmsEmailType is declared as:

TmsEmailType = (mseDefault, mseAOL, mseAppleLink, mseATTMail, mseCompuserve, mseInternet, mseIBM, mseMCI, msePowerShare, mseProdigy, mseTelex, mseX400);

And shows the kind of email address.  Default is Internet.

Example:

with msVCard1.TelecomInfo.Email1 do

begin

  EmailType:=mseInternet;

  Address:='jdoe@domain.com';

end;